home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Source / GNU / libg++ / libio / tests / tiomisc.cc < prev    next >
C/C++ Source or Header  |  1994-02-15  |  450b  |  34 lines

  1. /* Random regression tests etc. */
  2.  
  3. #include <fstream.h>
  4. #include <stdio.h>
  5. #include <strstream.h>
  6.  
  7. #define BUF_SIZE 4096
  8.  
  9. void
  10. test1 ()
  11. {
  12.    fstream f;
  13.    char    buf[BUF_SIZE];
  14.  
  15.    f.setbuf( buf, BUF_SIZE );
  16. }
  17.  
  18. void
  19. test2 ( )
  20. {
  21.    char string[BUF_SIZE];
  22.    ostrstream s( string, BUF_SIZE );
  23.  
  24.    s << "Bla bla bla " << 55 << ' ' << 3.23 << '\0' << endl;
  25.    cout << "Test2: " << string << endl;
  26. }
  27.  
  28. int main( )
  29. {
  30.   test1 ();
  31.   test2 ();
  32.   return 0;
  33. }
  34.